﻿@model EnterpriseFund.Model.DM_TZLX
@{
    Layout = null;
}
<!DOCTYPE html>
<html>
@Html.Partial("LoadPanelPartial")
<head>
    <title></title>
    @if (false)
    {
        <script src="../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>
    @Html.DevExpress().GetStyleSheets(

        new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme }
)
    @Html.DevExpress().GetScripts(
        new Script { ExtensionType = ExtensionType.ListBox }
)
    <script type="text/javascript">
        function OK() {

            lpModal.Show();
            var fTZLX_DM = tbTZLX_DM.GetText();
            var fTZLX_MC = tbTZLX_MC.GetText();
            var fYXBZ = "";
            var fGS_TZLX_MC = tbGS_TZLX_MC.GetText(); var FIsUse = "";
            if (tbYXBZ.GetChecked()) {
                fYXBZ = "Y";
            }
            else {
                fYXBZ = "N";
            }



            if (pd(fTZLX_DM, fTZLX_MC)) {
                fTZLX_DM = ASPxClientUtils.Trim(fTZLX_DM);
                fTZLX_MC = ASPxClientUtils.Trim(fTZLX_MC);
                fYXBZ = ASPxClientUtils.Trim(fYXBZ);
                fGS_TZLX_MC = ASPxClientUtils.Trim(fGS_TZLX_MC);
                $.ajax({
                    type: 'POST',
                    url: rootPath + '/TZLXManager/TZLXSave',
                    data: { TZLX_DM: fTZLX_DM, TZLX_MC: fTZLX_MC, GS_TZLX_MC: fGS_TZLX_MC, YXBZ: fYXBZ, isAdd: '@ViewData["blcodeNo"]' },
                    success: function (result) {
                        lpModal.Hide();
                        if (result == "exists") {
                            tbTZLX_DM.SetErrorText("编码已存在");
                            tbTZLX_DM.SetIsValid(false);
                        } else if (result == "ok") {
                            parent.codeOK();
                        } else if (result == "error") {
                            alert("保存失败");
                        }
                    }
                });

            } else {
                lpModal.Hide();
            }

        }


        function pd(codeNo, codeName) {
            var bl = true;
            if (null == codeNo || ASPxClientUtils.Trim(codeNo) == "") {
                tbTZLX_DM.SetErrorText("请填写调帐代码");
                tbTZLX_DM.SetIsValid(false);
                bl = false;
            }
            if (null == codeName || ASPxClientUtils.Trim(codeName) == "") {
                tbTZLX_MC.SetErrorText("请填写调帐名称");
                tbTZLX_MC.SetIsValid(false);
                bl = false;
            }
            //                        if (null == gscodename || ASPxClientUtils.Trim(gscodename) == "") {
            //                tbTZLX_MC.SetErrorText("请填写国税征收名称");
            //                tbTZLX_MC.SetIsValid(false);
            //                bl = false;
            //            }
            return bl;
        }

    </script>
</head>
<body>
    <table class="tableFrom">
        <tr>
            <th style="width: 150">
                调帐类型代码:
            </th>
            <td>
                @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "tbTZLX_DM";
                   settings.Width = 150;
                   if ((bool)@ViewData["blcodeNo"])
                   {
                       settings.ReadOnly = false;
                   }
                   else
                   {
                       settings.ReadOnly = true;
                   }
                   settings.Text = Model.TZLX_DM;
                   settings.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithText;
                   settings.Properties.ValidationSettings.EnableCustomValidation = true;
               }).GetHtml()
            </td>
        </tr>
        <tr>
            <th style="width: 150">
                调帐类型名称:
            </th>
            <td>
                @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "tbTZLX_MC";
                   settings.Width = 150;
                   settings.Text = Model.TZLX_MC;
                   settings.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithText;
                   settings.Properties.ValidationSettings.EnableCustomValidation = true;
               }).GetHtml()
            </td>
        </tr>
        <tr>
            <th style="width: 150">
                国税调帐类型名称:
            </th>
            <td>
                @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "tbGS_TZLX_MC";
                   settings.Width = 150;
                   settings.Text = Model.GS_TZLX_MC;
                   settings.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithText;
                   settings.Properties.ValidationSettings.EnableCustomValidation = true;
               }).GetHtml()
            </td>
        </tr>
        <tr>
            <th style="width: 150">
                有效标志:
            </th>
            <td>
                @Html.DevExpress().CheckBox(settings =>
               {
                   settings.Name = "tbYXBZ";
                   settings.Width = 150;
                   if (Model.YXBZ == "Y")
                   {
                       settings.Checked = true;
                   }
                   settings.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithText;
                   settings.Properties.ValidationSettings.EnableCustomValidation = true;
               }).GetHtml()
            </td>
        </tr>
    </table>
    <script>
        lp.Hide();
    </script>
</body>
</html>
